package com.atguigu.gulimall.cart.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

@FeignClient("gulimall-product")
public interface ProductFeign {
    /**
     * 信息
     */
    @RequestMapping("product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);

    /**
     * 根据id查询商品名字和值
     */
    @GetMapping("product/skusaleattrvalue/cart/skuId")
    public List<String> getAttrNameValue(@RequestParam("skuId") Long skuId);

    /**
     * 根据商品id查询商品价格
     */
    @GetMapping("product/skuinfo/price/{skuId}")
    public BigDecimal getPrice(@PathVariable("skuId")Long skuId );

}
